home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sysdeps / mach / Makefile < prev    next >
Makefile  |  1994-05-30  |  3KB  |  76 lines

  1. # Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License
  6. # as published by the Free Software Foundation; either version 2 of
  7. # the License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. ifndef mach-srcdir-computed
  20. mach-srcdir-computed := yes
  21.  
  22. # If we were configured with `--with-mach=DIR', then config.make sets
  23. # mach-srcdir to DIR.  Otherwise guess we are in a big source tree.
  24. ifndef mach-srcdir
  25. mach-srcdir = ../mach
  26. endif
  27.  
  28. # mach-srcdir is now set to the logical directory name.  This name might be
  29. # relative to $(objdir), might be relative to the source directory $(..), or
  30. # might be absolute.  We choose among these possibilities by looking for a
  31. # canonical file in each of those places (in that order).
  32. f := mach/mach.defs # Random file that identifies the Mach source dir.
  33. f := $(strip $f)
  34. mach-srcdir := $(firstword $(patsubst %/$f,%,$(wildcard $(addsuffix /$f,\
  35.            $(objpfx)$(mach-srcdir) $(..)$(mach-srcdir)))) $(mach-srcdir))
  36.  
  37. endif    # ! mach-srcdir-computed
  38.  
  39. ifdef in-Makerules
  40.  
  41. # Look for header files in mach/ under the top-level library source directory.
  42. includes += -I$(..)mach
  43.  
  44. # When compiling, use the Mach header files directly from the kernel sources.
  45. includes += -I$(mach-srcdir)
  46.  
  47. # Find Mach header files in the kernel source.
  48. vpath mach/%.h $(mach-srcdir)
  49. vpath device/%.h $(mach-srcdir)
  50.  
  51. ifneq (mach,$(subdir))
  52. # Subdirectories other than mach/ might use the generated Mach headers.
  53. # So make sure we get a chance to run in mach/ to make them before all else.
  54.  
  55. ifdef objpfx
  56. mach-objpfx = $(objpfx)
  57. else
  58. mach-objpfx = $(..)mach/
  59. endif
  60.  
  61. # These are all the generated files that <mach.h> includes.
  62. mach-before-compile := $(mach-objpfx)mach-shortcuts.h \
  63.                $(patsubst %,$(mach-objpfx)mach/mach_%.h,\
  64.                   interface port host)
  65.  
  66. # This patsubst generates patterns like `m%h-shortcuts.h', which are damn
  67. # likely to match just the corresponding particular file we want.
  68. $(patsubst mach%,m\%h%,$(mach-before-compile)): # Run only if doesn't exist.
  69.     @echo '+++ mach generation for $@: $^ ($?)'
  70.     $(MAKE) -C $(..)mach generated no_deps=t
  71.  
  72. before-compile += $(mach-before-compile)
  73. endif
  74.  
  75. endif    # in-Makerules
  76.